<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: younghxp
 * @Date: 2021-11-08 10:54:33
 * @LastEditors: younghxp
 * @LastEditTime: 2021-11-19 11:29:09
-->
<template>
  <div class="content">
    <topTitle
      :titleText="titleText"
      :back="back"
      @gobackTriser="goBack"
    ></topTitle>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="项目详情" name="first">
        <zj-project-detail v-if="isShowFirst"></zj-project-detail>
      </el-tab-pane>
      <el-tab-pane label="参建单位" name="second">
        <unit-list v-if="isShowSecond" :projectId="projectId"></unit-list>
      </el-tab-pane>
      <el-tab-pane label="班组" name="group">
        <group-list v-if="isShowGroup" :projectId="projectId"></group-list>
      </el-tab-pane>
      <el-tab-pane label="人员" name="person">
        <person-list v-if="isShowPerson" :projectId="projectId"></person-list>
      </el-tab-pane>
      <el-tab-pane label="合同" name="contract">
        <contract-list
          v-if="isShowContract"
          :projectId="projectId"
        ></contract-list>
      </el-tab-pane>
      <el-tab-pane label="进退场" name="enter">
        <enter-list v-if="isShowEnter" :projectId="projectId"></enter-list>
      </el-tab-pane>
      <el-tab-pane label="工资" name="salary">
        <zj-salary-list
          v-if="isShowSalary"
          :projectId="projectId"
        ></zj-salary-list>
      </el-tab-pane>
      <el-tab-pane label="考勤" name="attendance">
        <attendance-list
          v-if="isShowAttendance"
          :projectId="projectId"
        ></attendance-list>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import zjProjectDetail from '@/components/zhujianData/zjProjectDetail'
import unitList from '@/components/zhujianData/unitList'
import groupList from '@/components/zhujianData/groupList'
import personList from '@/components/zhujianData/personList'
import contractList from '@/components/zhujianData/contractList'
import enterList from '@/components/zhujianData/enterList'
import zjSalaryList from '@/components/zhujianData/zjSalaryList'
import attendanceList from '@/components/zhujianData/attendanceList'

export default {
  name: 'zjSeeProDetail',
  data() {
    return {
      titleText: '',
      activeName: 'first',
      isShowFirst: true,
      list: [],
      back: true,
      isShowSecond: false,
      isShowGroup: false,
      isShowPerson: false,
      isShowContract: false,
      isShowEnter: false,
      isShowSalary: false,
      isShowAttendance: false,
      projectId: '',
    }
  },
  components: {
    zjProjectDetail,
    unitList,
    groupList,
    personList,
    contractList,
    enterList,
    zjSalaryList,
    attendanceList,
  },

  created() {
    this.titleText = this.$route.query.projectName
    this.projectId = this.$route.query.projectId
  },
  methods: {
    handleClick(tab, event) {
      if (tab.label == '项目详情') {
        this.isShowFirst = true
      } else if (tab.label == '参建单位') {
        this.isShowSecond = true
      } else if (tab.label == '班组') {
        this.isShowGroup = true
      } else if (tab.label == '人员') {
        this.isShowPerson = true
      } else if (tab.label == '合同') {
        this.isShowContract = true
      } else if (tab.label == '进退场') {
        this.isShowEnter = true
      } else if (tab.label == '工资') {
        this.isShowSalary = true
      } else if (tab.label == '考勤') {
        this.isShowAttendance = true
      }
    },
    goBack() {
      this.$router.push('/home/zhujianData/zjProjectInfo')
      this.$store.commit('CHANGE_SLIDER_NAME', {
        oldUrl: '/home/zhujianData/zjProjectInfo',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
  },
}
</script>
<style lang="less" scoped>
.content {
  .topBox {
    height: 53px;
    padding: 0 24px;
    line-height: 54px;
    border-bottom: 1px solid #dbdbdb;
    position: relative;
    .title {
      font-size: 22px;
      color: #242c3b;
      font-weight: 700;
    }
    .jumpBtn {
      width: 136px;
      height: 36px;
      position: absolute;
      top: 50%;
      right: 24px;
      transform: translateY(-50%);
    }
  }
  /deep/ .el-tabs__header {
    margin-bottom: 0;
  }
  /deep/ .el-tabs__nav-scroll {
    padding: 0 24px;
  }
  /deep/ .el-tabs__item {
    height: 46px;
    line-height: 46px;
  }
  /deep/ .el-tabs__item.is-active {
    font-size: 14px;
    color: #3189ea;
    font-weight: 700 !important;
  }
  /deep/ .el-tabs__nav-wrap::after {
    height: 1px;
    background-color: #dbdbdb;
  }
  /deep/ .el-tabs__active-bar {
    background: #3189ea !important;
  }
}
@import '../../../static/css/filterArea.less';
</style>
